package com.softeem.ssm2.controller;

import com.softeem.ssm2.entity.Department;
import com.softeem.ssm2.service.IDepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author mrchai
 * @Date 2019/10/12 10:38
 */
@RequestMapping("/dept")
@Controller
public class DepartmentController {

    @Autowired
    private IDepartmentService departmentService;

    /**
     * 根据编号查询专业信息
     * @param dno 专业编号
     * @return  返回专业对象
     */
    @ResponseBody
    @RequestMapping("query/id/{dno}")
    public Department queryByDno(@PathVariable Integer dno){
        System.out.println("进入departmentController");
        return departmentService.queryByDno(dno);
    }
}
